<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>
		<?php echo Configure::read('cmsConfig.Backend.siteName');?> <?php echo __("Admin Panel")?> :: 
		<?php echo $title_for_layout; ?>
	</title>
	<script>
	var URL='<?php echo Configure::read('cmsConfig.Backend.siteUrl');?>';
	var ErrorMsg = <?php echo $encodedErrorMsgs?>;
	</script>
	
	<?php
		echo $javascript->link(array('/js/jquery-1.7.2.min','/cms/js/main.js','/js/main.js','/js/adminNav.js'));
		
		echo $html->charset();
		echo $html->meta('icon');
		echo $html->defaultCss();
		//echo $html->css('style');
		echo $html->css('/backend/css/backend');
		echo $html->css('breadcrumb');
		echo $html->css('fonts');

		echo $html->css('admin');

		echo $javascript->getCompressedJs();
		echo $scripts_for_layout;
		echo $html->getCompressedCss();
		echo $startup_js;
	?>	
<style>
.page {
margin:0 auto;
width:95%;}
</style>
</head>
<body>

	<?php  if($session->read('admin_user')) { ?>
		
		<div id="sidebar">
			
			<a href="<?php echo $html->url('/admin')?>"><h2 class="admin_logo"><?php echo __("Admin Panel")?></h2></a>
     
							<?php  
				if(!isset($backend) || !is_object($backend))
				{
					require_once(BACKEND_PATH.'views'.DS.'helpers'.DS.'backend.php');
					$backend = new BackendHelper();
				}
				callHooks('buildAdminMenu','.+', $backend); ?>
				<ul class="left-nav"> 
					<?php echo $backend->showMenu(); ?>
				</ul>
			
	
	
		</div> <!-- End #sidebar -->
				<?php  } ?>
		
		<div id="main-content"> 
					<div class="header">
			
			
			<?php  if($session->read('admin_user')) { ?>
	
			<ul class="links">
			<li><strong><?php echo __("Hello")?> <?php  echo $session->read('admin_user'); ?>!</strong></li>
			<li><a href="<?php echo $html->url('/admin/backend');?>"><img class="icon" alt="" src="<?php echo $html->url('/img/admin/chart_bar.png');?>"/> <span class="text"><?php echo __("Go to Dashboard")?></span></a></li>
			<li><a href="<?php echo $html->url('/');?>" target="_blank"><img class="icon" alt="view site" src="<?php echo $html->url('/img/admin/search.png');?>" /> <span class="text"><?php echo __("View site")?></span></a></li>
			<li><a href="<?php echo $html->url('/admin/backend/logout');?>"><img class="icon" alt="" src="<?php echo $html->url('/img/admin/delete.png');?>"/> <span class="text"><?php echo __("Logout")?></span></a></li>
			</ul>
			<div class="clear"></div>
			<?php  } ?>

		</div>
						<?php if(!isset($hideLayoutTitle) || $hideLayoutTitle != true){?>
			<h1><?php echo $title_for_layout; ?></h1>
			<?php 
				if(isset($breadCrumb))
				{
					$breadCrumb->breadCrumbElement = "bread_crumb_app";
					$breadCrumb->SiteTreeCallbacksObject = new AdminSiteTreeCallbacks();
					echo $breadCrumb->showFromPresentUrl(CONFIGS.'url'.DS.'admin_site.xml');
				}?><br/><?php
			?>
			<?php }?>
			<?php
				if ($session->check('Message.flash')):
						$session->flash();
						echo "<br />";
				endif;
			?>


			<?php echo $content_for_layout; ?>
			
			<style>
			.cake-sql-log
			{
				margin-top: 600px;
			}
			</style>
			<?php echo $cakeDebug; ?>
		</div> <!-- End #main-content -->


	
</body>
</html>
